# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Contributor: Nicolas F. <aur@fratti.ch>

pkgname=oxipng
pkgver=8.0.0
pkgrel=1
pkgdesc="A lossless PNG compression optimiser"
arch=(loong64 x86_64)
url="https://github.com/shssoichiro/oxipng"
license=('MIT')
depends=('gcc-libs')
options=('!lto')
makedepends=('rust')
source=("$pkgname-$pkgver.tar.gz::https://github.com/shssoichiro/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('ef96d6340e70900de0a38ace8f5f20878f6c256b18b0c59cd87f2b515437b87b')

build() {
  cd "$pkgname-$pkgver"

  cargo build --release --locked
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm755 target/release/oxipng "$pkgdir/usr/bin/oxipng"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
